﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;

namespace TheOutfield.UmbExt.UniversalMediaPicker.Providers.Screenr
{
    public static class ScreenrExtensions
    {
        public static MediaItem ToMediaItem(this ScreenrVideo video)
        {
            var mi = new MediaItem
            {
                Id = video.Link,
                Title = video.Title,
                PreviewImageUrl = "/umbraco/images/screenr.jpg",
                Icon = "screenrMedia.png",
                HasChildren = false,
                Selectable = true
            };

            mi.MetaData.Add("Width", video.Width.ToString());
            mi.MetaData.Add("Height", video.Height.ToString());
            mi.MetaData.Add("Author", video.Author);

            return mi;
        }
    }
}